package lichao.service;

import lichao.entity.User;
import lichao.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserService {

    @Autowired
    UserMapper userMapper;

    @Transactional
    public void addUser() {
        User user = new User();
        user.setName("张三");
        userMapper.addUser(user);
        int a = 1 / 0;
        userMapper.addtbUser("add", "heed");
    }
}
